//
//  UIImageView+QiNiu.m
//  TipsProject
//
//  Created by Suny on 15/6/24.
//  Copyright (c) 2015年 Suny. All rights reserved.
//

#import "UIImageView+QiNiu.h"
#import "UIImageView+WebCache.h"
@implementation UIImageView (QiNiu)

- (void)setQNImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder 
{
	NSInteger width = self.width;
	NSInteger height = self.height;
	
	NSString *urlString = [url absoluteString];
	urlString = [NSString stringWithFormat:@"%@?imageView2/1/w/%ld/h/%ld",urlString,(long)width,(long)height];
	[self sd_setImageWithURL:[NSURL URLWithString:urlString] 
			placeholderImage:placeholder];
}


- (void)setQNImageAdjustHeightWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder 
{
	NSInteger width = self.width;
	
	NSString *urlString = [url absoluteString];
	urlString = [NSString stringWithFormat:@"%@?imageView2/2/w/%ld",urlString,(long)width];
	[self sd_setImageWithURL:[NSURL URLWithString:urlString] 
			placeholderImage:placeholder];
}
@end
